//
//  SXWYNewsOneImageCell.m
//  ShiXun
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXWYNewsOneImageCell.h"
#import "UIImageView+WebCache.h"
#import "SXWYNewsCommonCell.h"
@implementation SXWYNewsOneImageCell
- (void)setConfigureModel:(SXWYNewsMainModel *)configureModel
{
    _configureModel = configureModel;
    _titleLabel.text = configureModel.title;
    [_coverImg sd_setImageWithURL:[NSURL URLWithString:configureModel.imgsrc] placeholderImage:[UIImage imageNamed:@"SX-placeholder"]];
    _contentLabel.text = configureModel.digest;
    [SXWYNewsCommonCell changeLineSpace:_contentLabel];
    _replyLabel.text = configureModel.source;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth - 20, 16)];
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:_titleLabel];
        
        _coverImg = [[UIImageView alloc] initWithFrame:CGRectMake(10, 36, kScreenWidth - 20, (kScreenWidth - 20) / 3)];
        [self.contentView addSubview:_coverImg];
        
        _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 40 + (kScreenWidth - 20) / 3, kScreenWidth - 20, 40)];
        _contentLabel.font = [UIFont systemFontOfSize:13];
        _contentLabel.textColor = [UIColor grayColor];
        _contentLabel.numberOfLines = 2;
        [self.contentView addSubview:_contentLabel];
        
        _replyLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 150, 60 + (kScreenWidth - 20) / 3, 140, 20)];
        _replyLabel.textAlignment = NSTextAlignmentRight;
        _replyLabel.textColor = [UIColor grayColor];
        _replyLabel.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_replyLabel];
    }
    return self;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
